package net.jcip.examples.counters;

import java.util.concurrent.atomic.AtomicLong;

public class SafeAtomicCounter implements LongCounter {

    private AtomicLong counter = new AtomicLong(0);

    @Override
    public void reset() {
        counter.set(0);
    }

    @Override
    public void increment() {
        counter.incrementAndGet();
    }

    @Override
    public long getCounter() {
        return counter.get();
    }
}
